package com.oig.auth.api.factory;

import com.oig.auth.api.ResourceService;
import com.oig.auth.api.fallback.ResourceServiceFallbackImpl;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class ResourceFallbackFactory implements FallbackFactory<ResourceService> {

    @Override
    public ResourceService create(Throwable cause) {
        ResourceServiceFallbackImpl resourceServiceFallback = new ResourceServiceFallbackImpl();
        resourceServiceFallback.setCause(cause);
        return resourceServiceFallback;
    }
}
